package fxbattle.client.model;

import fxbattle.client.model.Player;

/**
 * This contains data about a particular army.
 * 
 * @author spina
 */
public class Army {

    public static Army no_army = new Army(Player.no_player, 0);
    public static final double MAX_ARMY_SIZE = 100;

    private double size;
    private final Player fOwner;
    
    public Army(Player iPlayer, double iSize){
        size = iSize > MAX_ARMY_SIZE ? MAX_ARMY_SIZE : iSize;
        fOwner = iPlayer;
    }

    public Player getOwner(){
        return fOwner;
    }
    
    public double size(){
    	return size;
    }
    
    public double sizeAsPercentage(){
    	return size / MAX_ARMY_SIZE;
    }
    
    @Override
    public String toString() {
    	return getOwner().getName() + "s army of size " + size;
    }

}
